<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <!--
        =================================================
        * 页面名称: 500服务器错误模板
        * 文件路径: 500.html
        * 作者: 孤山寺北
        * 邮箱: 3150675236@qq.com
        * 网站: https://www.gsav.cn
        * 创建日期: 2025-7-3
        * 最后更新: 2025-7-3
        * 版本: v1.0.0
        * 版权声明: Copyright (c) 2025 GSAV.CN . 保留所有权利。
        * 许可证: MIT License
        * 描述: 服务器错误模板
        =================================================
    -->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>服务器错误</title>
    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap">
    <link rel="stylesheet" href="style.css">
    <style>
        :root {
            --primary: #3b82f6;
            --error: #dc2626;
            --text: #1f2937;
            --text-light: #6b7280;
            --border: #e5e7eb;
            --radius: 8px;
            --space: 24px;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        .status-icon-circle {
            border-color: var(--error);
        }

        .status-icon-inner {
            background-color: var(--error);
        }

        .error-details {
            background-color: #f9fafb;
            padding: 16px;
            border-radius: var(--radius);
            margin-bottom: var(--space);
            font-family: 'Menlo', 'Consolas', monospace;
            font-size: 0.8125rem;
            text-align: left;
            color: var(--text-light);
            border: 1px solid var(--border);
            opacity: 0;
            animation: fadeInUp 0.5s ease-out 0.4s forwards;
        }

        .copy-btn {
            background-color: white;
            color: var(--primary);
            border: 1px solid var(--border);
            padding: 6px 12px;
            border-radius: 4px;
            font-size: 0.75rem;
            cursor: pointer;
            margin-top: 8px;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }
    </style>
</head>
<body>
    <div class="status-container">
        <div class="status-icon">
            <div class="status-icon-circle"></div>
            <div class="status-icon-inner">
                <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path>
                </svg>
            </div>
        </div>
        
        <h1>服务器错误</h1>
        <p class="status-message">我们正在紧急修复此问题</p>
        
        <div class="error-details">
            <p>错误ID: <span id="errorId">ERR_${Math.random().toString(36).substr(2, 8).toUpperCase()}</span></p>
            <p>时间: <span id="errorTime">${new Date().toLocaleString()}</span></p>
            <button class="copy-btn" id="copyErrorBtn">
                <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
                    <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
                </svg>
                复制错误信息
            </button>
        </div>
        
        <div class="action-buttons">
            <button class="btn btn-primary" id="reloadBtn">
                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <path d="M21.5 2v6h-6M2.5 22v-6h6M22 12.5a10 10 0 0 1-17.2 6.8M2 11.5a10 10 0 0 1 17.2-6.8"/>
                </svg>
                重新尝试
            </button>
            <button class="btn btn-secondary" id="supportBtn">
                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <circle cx="12" cy="12" r="10"></circle>
                    <circle cx="12" cy="12" r="4"></circle>
                    <line x1="4.93" y1="4.93" x2="9.17" y2="9.17"></line>
                    <line x1="14.83" y1="14.83" x2="19.07" y2="19.07"></line>
                    <line x1="14.83" y1="9.17" x2="19.07" y2="4.93"></line>
                    <line x1="14.83" y1="9.17" x2="18.36" y2="5.64"></line>
                    <line x1="4.93" y1="19.07" x2="9.17" y2="14.83"></line>
                </svg>
                技术支持
            </button>
        </div>
    </div>
    
    <footer>
        <p>&copy; <span id="year"></span> 孤山寺北 · <a href="/status" style="color: var(--primary); text-decoration: none;">系统状态</a></p>
    </footer>

    <script>
        // 自动更新版权年份
        document.getElementById('year').textContent = new Date().getFullYear();
        document.addEventListener('DOMContentLoaded', function() {
            // 复制错误信息
            document.getElementById('copyErrorBtn').addEventListener('click', function() {
                const errorInfo = `错误ID: ${document.getElementById('errorId').textContent}\n` +
                                `时间: ${document.getElementById('errorTime').textContent}\n` +
                                `页面: ${window.location.href}`;
                
                navigator.clipboard.writeText(errorInfo).then(() => {
                    const originalText = this.innerHTML;
                    this.innerHTML = '<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';
                    
                    setTimeout(() => {
                        this.innerHTML = originalText;
                    }, 2000);
                });
            });
            
            // 按钮事件
            document.getElementById('reloadBtn').addEventListener('click', function() {
                window.location.reload();
            });
            
            document.getElementById('supportBtn').addEventListener('click', function() {
                window.location.href = '/contact-support?error=' + document.getElementById('errorId').textContent;
            });
        });
    </script>
</body>
</html>